﻿<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <style>
        #myDiv .imgBox {
            display: inline-block;
            height: 280px;
            width: 200px;
            font-size: 12px;
            margin: 2px;
            overflow: hidden;
        }

        #myDiv .imgBox img {
            width: 100px;
            height: 100px;
        }

        #myDiv .imgBox .FaceQuality {
            width: 100px;
            height: 100px;
        }
    </style>
    <script src="config.js"></script>
    <script src="jquery-3.3.1.min.js"></script>
    <script src="jquery.lazyload.min.js"></script>
    <script>
        $(function () {
            var serverIP = caijingdaxueip;                                    //要访问的Ip
            var id = decodeURI(window.location.href).split("?id=")[1];        //人档id
            if (id) {
                $("#id").val(id);
                $.get(serverIP + "/acvsSub?id=" + $("#id").val(), function (data) {
                    loadJSON(JSON.parse(data))
                })
            }

            //生成结果
            function loadJSON(arcs) {
                console.log(arcs);
                for (var i = 0; i < arcs.length; i++) {

                    var count = (arcs[i].count != null) ? '<div>count:' + arcs[i].count + '</div>' : "";
                    var acvsid = (arcs[i]._id != null) ? '<div>' + arcs[i]._id + '</div>' : "";
                    var url = "caijingacvs.html?id=" + arcs[i]._id;
                    var arr = Object.keys(arcs[i]);

                    if (arr.length == 0) {
                        var $item = $('<br>' + '<hr>' + '<br>' + '<br>' + '<br>' + '<hr>');
                    }

                    else {
                        var $item = $('<div class="imgBox">' +
                            '<a href="' + url +' " target="_blank">   <img src="' + arcs[i]["face_image_uri"] + '" alt="' + arcs[i]._id + '"> </a>' +

                            count +

                            acvsid +
                            //'<div title="'+ arcs[i].emoticons +'">'+ arcs[i].emoticons+'</div>' +
                            //'<div>quality:'+ (arcs[i].quality === undefined?'':Number(arcs[i].quality).toFixed(2))+'</div>' +
                            //'<div title="'+ Number(arcs[i].FaceQuality).toFixed(2) +'">FaceQuality:'+ (arcs[i].FaceQuality === undefined?'':Number(arcs[i].FaceQuality).toFixed(2))+'</div>' +
                            //d +
                            //faceid +

                            '</div>')
                    }
                    $('#myDiv').append($item)
                }
                $("img").lazyload();

            }
        })
    </script>
</head>
<body style='background:#777'>
<input id="id" type="hidden" value=""/>
<div id="myDiv"></div>
</body>
</html>